package com.platform.module.service.impl;

import java.util.List;
import java.util.Arrays;
import com.platform.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.platform.module.mapper.HeatUserMapper;
import com.platform.module.domain.HeatUser;
import com.platform.module.service.IHeatUserService;
import com.platform.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * 供热用户信息Service业务层处理
 * 
 * @author wangqi
 * @date 2020-08-19
 */
@Service
public class HeatUserServiceImpl extends ServiceImpl<HeatUserMapper,HeatUser> implements IHeatUserService
{
    @Autowired
    private HeatUserMapper heatUserMapper;

    /**
     * 查询供热用户信息列表
     * 
     * @param heatUser 供热用户信息
     * @return 供热用户信息
     */
    @Override
    public List<HeatUser> selectHeatUserList(HeatUser heatUser)
    {
        return heatUserMapper.selectHeatUserList(heatUser);
    }

    /**
     * 新增供热用户信息
     * 
     * @param heatUser 供热用户信息
     * @return 结果
     */
    @Override
    public int insertHeatUser(HeatUser heatUser)
    {
        heatUser.setCreateTime(DateUtils.getNowDate());
        return heatUserMapper.insert(heatUser);
    }

    /**
     * 修改供热用户信息
     * 
     * @param heatUser 供热用户信息
     * @return 结果
     */
    @Override
    public int updateHeatUser(HeatUser heatUser)
    {
        heatUser.setUpdateTime(DateUtils.getNowDate());
        return heatUserMapper.updateById(heatUser);
    }

    /**
     * 删除供热用户信息对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteHeatUserByIds(String ids)
    {
        return heatUserMapper.deleteBatchIds(Arrays.asList(Convert.toStrArray(ids)));
    }

    /**
     * 删除供热用户信息信息
     * 
     * @param usId 供热用户信息ID
     * @return 结果
     */
    @Override
    public int deleteHeatUserById(Long usId)
    {
        return heatUserMapper.deleteById(usId);
    }
}
